import {JsonController,Controller, Render, Get, UseBefore, Session,Req,Res,Ctx,QueryParams,UseInterceptor,Post,Body} from "routing-controllers";
import { config } from "../../config";
import { getHistoryThinkModel } from "../../model/HistoryModel";
import { Service, Inject } from "typedi";
import {HistoryServiceImpl} from '../../service/impl/HistoryServiceImpl'
import TokenLoginMiddlewares from '../../middleware/TokenLoginMiddlewares';
import { JsonResponseInterceptor } from "../../middleware/JsonResponseMiddlewares";

@Service()
@JsonController(`${config.apiurl}/v1/history`)
@UseInterceptor(JsonResponseInterceptor)
@UseBefore(TokenLoginMiddlewares)
export class HistoryControllerApi {



    @Inject()
    private HistoryServiceImpl!:HistoryServiceImpl;


    @Get("/getHistorySplashData")
    public async getHistorySplashData (@Res() response: any,@Session() session:any,): Promise<any> {
        return await this.HistoryServiceImpl.getAllHistorySplashData();
    }

    @Get("/getHistoryThink")
    public async getHistoryThink (@Res() response: any,@Session() session:any,@QueryParams() params:getHistoryThinkModel): Promise<any> {

        return await this.HistoryServiceImpl.getHistoryThink(params.think_Page,params.think_Count,params.history_Index);
    }

  }